﻿import os,time
def fun1():
    while 1:
        status = os.system('ping www.baidu.com')
        if status==1:
            print ("掉线")
            os.system('netsh wlan connect name=sky5')
        else:
            print("已连接")
        time.sleep(30)
fun1()